home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Opus5.5
/
ARexx.lha
/
ARexx
/
FIDList.dopus5
< prev
next >
Wrap
Text File
|
1996-05-03
|
3KB
|
115 lines
/*
$VER: FIDList.dopus5 1.6 (15.3.96)
Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
ARexx script for Directory Opus 5.5 to list all selected files in the
source with their 'FILE_ID.DIZ' description.
Function : ARexx DOpus:ARexx/FIDList.dopus5 {Qp} "T:FIDList.txt"
*/
parse arg portname . '"' outfile '"'
if portname='' then /* in case they forgot */
portname='DOPUS.1'
address value portname
if outfile='' then
outfile='T:FIDList.txt'
options results
options failat 21
if ~show('l','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30,0) /* for delete() */
lf='0a'x
lister query source
if rc>0 then
exit
parse var result handle . /* only need first source */
lister set handle busy on
lister query handle path
srcpath=result
lister query handle selfiles stem file.
lister set handle progress file.count 'Making File ID List...'
lister set handle title 'Making File ID List...'
lister refresh handle full
call open('output',outfile,'w')
call writeln('output',"File ID List of '"srcpath"' on" date('n'))
call writeln('output','')
if exists('T:FILE_ID.DIZ') then do
command wait protect name 'T:FILE_ID.DIZ' set 'RWED'
call delete('T:FILE_ID.DIZ')
end
do i=0 to file.count-1
lister query handle abort
if result then
signal quitit
lister set handle progress name file.i
lister set handle progress count i+1
lister query handle entry file.i stem fileinfo.
beginline=left(fileinfo.name,31-length(fileinfo.size))' 'fileinfo.size
thisfile='"'srcpath||fileinfo.name'"'
ext=reverse(fileinfo.name)
parse var ext ext '.'
ext=upper(reverse(ext))
if ext='LHA'|ext='LZH'|ext='RUN' then
address command 'LhA e -q -Qw -Qo' thisfile 'T: FILE_ID.DIZ'
if ext='LZX' then
address command 'LZX >NIL: x' thisfile 'FILE_ID.DIZ T:'
if ext='DMS' then
address command 'DMSDescript >NIL: x T:FILE_ID.DIZ' thisfile
if ext='README' then do /* Aminet description */
call open('readme',srcpath||fileinfo.name,'r')
desc=readln('readme')
close('readme')
parse var desc ':' desc
beginline=beginline strip(desc,'b')
end
if open('fileid','T:FILE_ID.DIZ','r') then do
do while ~eof('fileid')
idline=compress(readln('fileid'),'0d1a'x)
if ~(idline==''&eof('fileid')) then do
call writeln('output',beginline idline)
beginline=copies(' ',32)
end
end
call close('fileid')
command wait protect name 'T:FILE_ID.DIZ' set 'RWED'
call delete('T:FILE_ID.DIZ')
end
else
call writeln('output',beginline)
lister select handle '"'fileinfo.name'"' off /* deselect file */
end
quitit:
lister set handle title /* reset title text */
lister clear handle progress
lister refresh handle full
lister set handle busy off
call close('output')
command protect name '"'outfile'"' clear 'E'
command read outfile /* display generated File ID List */